<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/23 0023
 * Time: 14:59
 */
namespace app\modules\api\controllers;
use app\modules\api\models\PublishForm;
use app\hejiang\BaseApiResponse;
use app\models\Video;

class VideoController extends Controller
{

    //视频列表
    public function actionList()
    {

        $list = Video::find()->where([
            'is_delete' => 1,
        ])->orderBy('addtime DESC')->all();
        if($list){
            return new BaseApiResponse(['code'=>0,'msg'=>"操作成功",'data'=>$list]);
        }

    }
    //视频详细
    public function actionDetail()
    {
        $id=\yii::$app->request->post('id');
        if($id==null){
            return new BaseApiResponse(['code'=>1,'msg'=>"id不能为空"]);
        }
        $model = Video::findOne([
            'id' => $id,
        ]);
        if ($model){
            return new BaseApiResponse(['code'=>0,'msg'=>"操作成功",'data'=>$model]);
        }

    }
}
